﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 面向对象
{
   public class Person
    {
        //get get get get get get get get get get get get get get get get get get get get 
        //set set set set set set set set set set set set set set set set set set set set 
        private string _name;
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        private int _age;
        public int Age
        {
            get { return _age; }
            set {
                if (value < 0 || value > 100)
                {
                    value = 0;
                }
                
                _age = value; }
        }
        private char _gander;
        public char Gander
        {
            get {
                if (_gander != '男' && _gander != '女')
                {
                    return _gander = '男';
                }
                return _gander; }
            set { _gander = value; }
        }

        public  void CHLSS()
        {
            Console.WriteLine("我{0}今年{1}岁，我是个{2}生，我很帅",this.Name,this.Age,this.Gander);
        }
    }
}
